import { createRouter, createWebHistory } from 'vue-router'
import login from '@/pages/login.vue'
import Home from '@/pages/Home.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect: '/login' },
    {
      path: '/login',
      name: 'login',
      component: login,
    },
    { path: '/home',    
      name: 'home',    
      component: Home ,
      children: [
        { path: '/home', redirect: '/home/employee' },
        // { path: '/home/student', component: () => import('../pages/student.vue') },
        // { path: '/home/teacher', component: () => import('../pages/teacher.vue') }
        { path: '/home/employee', component: () => import('../pages/employee.vue') },
        { path: '/home/salary', component: () => import('../pages/salary.vue') },
        { path: '/home/department', component: () => import('../pages/department.vue') },
      ]
    },  
  ],
})

export default router
